#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Attributes:
    __version__ (str): "0.0.1"
    __copyright__ (str): "Copyright (C) 2025 z"
    __license__ (str): "MIT"
    __author__ (str): "Z"
"""

# from __future__ import print_function, unicode_literals, absolute_import, division

from flask import Flask

class FlaskApp(Flask):
    """
    扩展Flask
    """
    # 需要转为json的类型
    # json_data_class = (list, dict)

    def get(self, rule, **options):
        options.setdefault('methods', ['GET'])
        return super(FlaskApp, self).route(rule, **options)

    def post(self, rule, **options):
        options.setdefault('methods', ['POST'])
        return super(FlaskApp, self).route(rule, **options)
